import { ObjCreate } from "../common/ObjCreate";
import { Language } from "../../../../extend/language/Language";
import { GTileList } from "../../../../com/mui/controls/GTileList";
import { NearbyPlayerCellRenderer } from "./NearbyPlayerCellRenderer";
import { ScrollBarDirection } from "../../../../fl/controls/ScrollBarDirection";
import { DataProvider } from "../../../../fl/data/DataProvider";
//class NearbyPlayersPanel
    
    export  class NearbyPlayersPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.createChildren();
            return;
        }

        /* internal  */createChildren(): void
        {
            ObjCreate.createLabel(Language.getString(62052), 33, 0, 75, 20, flash.text.TextFormatAlign.LEFT, this, true, 16645577);
            ObjCreate.createLabel(Language.getString(62053), 108, 0, 75, 20, flash.text.TextFormatAlign.LEFT, this, true, 16645577);
            ObjCreate.createLabel(Language.getString(62054), 140, 0, 75, 20, flash.text.TextFormatAlign.LEFT, this, true, 16645577);
            ObjCreate.createLabel(Language.getString(62055), 175, 0, 75, 20, flash.text.TextFormatAlign.LEFT, this, true, 16645577);
            ObjCreate.createLabel(Language.getString(62056), 207, 0, 75, 20, flash.text.TextFormatAlign.LEFT, this, true, 16645577);
            this._playersTileList = new GTileList();
            this._playersTileList.move(0, 21);
            this._playersTileList.setSize(272, 324);
            this._playersTileList.styleName = "TileList";
            this._playersTileList.setStyle("cellRenderer", NearbyPlayerCellRenderer);
            this._playersTileList.direction = ScrollBarDirection.VERTICAL;
            this._playersTileList.columnWidth = 260;
            this._playersTileList.rowHeight = 38;
            this.addChild(this._playersTileList);
            return;
        }

        public updateNearbyPlayerList(arg1: Array<any>): void
        {
            if (!this._dp) 
            {
                this._dp = new DataProvider();
            }
            this._dp.removeAll();
            this._dp.addItems(arg1);
            this._playersTileList.dataProvider = this._dp;
            return;
        }

        /* internal */ /* var */_playersTileList: GTileList;

        /* internal */ /* var */_dp: DataProvider;
    }
